package com.taplinker.client.im.domain;

public enum EnumMessageType {
	TEXT("text"), IMAGE("image"), AUDIO("audio"), ;

	private String type;

	EnumMessageType(String type) {
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean equals(EnumMessageType t) {
		if (t == null) {
			return false;
		}
		if (type.equals(t.getType())) {
			return true;
		}
		return false;
	}

	public static EnumMessageType getByType(String type) {
		if (TEXT.equals(type)) {
			return TEXT;
		} else if (IMAGE.equals(type)) {
			return IMAGE;
		} else if (AUDIO.equals(type)) {
			return AUDIO;

		} else {
			return TEXT;
		}
	}

}
